#ifndef __IM_IO_UNIX_H__
#define __IM_IO_UNIX_H__

#include <im_io_channel.h>
/**
 * @defgroup IMIOChannelUnix
 * @ingroup PrivateIMBus
 * @{
 */

/** @struct IMIOChannelUnix
 *  @brief It's a real iochannel implementation for unix environment.
 */

IM_BEGIN_DECLS

#define IM_IO_CHANNEL_UNIX(p)           (IM_TYPE_INSTANCE_CHECK_CAST((p),IM_TYPE_IO_CHANNEL_UNIX,IMIOChannelUnix))
#define IM_CONST_IO_CHANNEL_UNIX(p)     (IM_TYPE_INSTANCE_CHECK_CAST_CONST((p),IM_TYPE_IO_CHANNEL_UNIX,IMIOChannelUnix))
#define IM_IO_CHANNEL_UNIX_CLASS(c)     (IM_TYPE_CLASS_CHECK_CAST((c),IM_TYPE_IO_CHANNEL_UNIX,IMIOChannelUnixClass))
#define IM_IS_IO_CHANNEL_UNIX(p)        (IM_TYPE_INSTANCE_CHECK_TYPE((p),IM_TYPE_IO_CHANNEL_UNIX))
#define IM_IS_IO_CHANNEL_UNIX_CLASS(c)  (IM_TYPE_CLASS_CHECK_TYPE((c),IM_TYPE_IO_CHANNEL_UNIX))
#define IM_IO_CHANNEL_UNIX_GET_CLASS(p) (IM_TYPE_INSTANCE_GET_CLASS_CAST((p),IM_TYPE_IO_CHANNEL_UNIX,IMIOChannelUnixClass))

typedef struct _IMIOChannelUnix         IMIOChannelUnix;
typedef struct _IMIOChannelUnixClass    IMIOChannelUnixClass;

/**
 * @brief Create new I/O Channel for specific unix fd.
 *
 * The returned I/O Channel is owned by caller, so it
 * must be destroyed by calling im_object_unref() afterwards.
 */
IMIOChannel*    im_io_channel_unix_new      (int    fd);

IMInt           im_io_channel_unix_get_fd   (IMIOChannel    *channel);

/**
 * @brief Create new I/O Channel by openning a file.
 *
 * The returned I/O Channel is owned by caller, so it
 * must be destroyed by calling im_object_unref() afterwards.
 */
IMIOChannel*    im_io_channel_unix_new_file (const IMChar   *filename,
                                             const IMChar   *mode,
                                             IMIOError      *error);

IM_END_DECLS
/** @} */

#endif
/*
vi:ts=4:nowrap:ai:expandtab
*/
